//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        printHelloworld();
        System.out.println("----------------------");
        System.out.println(sum(1,2));
        System.out.println("----------------------");
        printLiterals();
        System.out.println("----------------------");

        printHelloworldByFor();
        System.out.println("----------------------");
    }

    //打印三行HelloWorld
    public static void printHelloworld(){
        final String MESSAGE = "HelloWorld";
        final int REPEAT_COUNT = 3;

        for (int i = 0; i < REPEAT_COUNT; i++) {
            System.out.println(MESSAGE);
        }
    }

    //求两个整数的和
    public static int sum(int a,int b){
        return a+b;
    }
    //输出常见字面量
    public static void printLiterals(){
        System.out.println(true);
        System.out.println(false);
        System.out.println(1);
        System.out.println(1L);
        System.out.println(1.0);
        System.out.println(1.0f);
        System.out.println('a');
        System.out.println("hello world");

    }


    //for循环输出10次HelloWorld
    public static void printHelloworldByFor(){
        for (int i = 0; i < 10; i++) {
            System.out.println("HelloWorld");
        }
    }
}